package com.yidu.qx.domain;

import org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

/**
 * @program: ssh
 * @description:
 * @author: 张超王八蛋
 * @create: 2019-09-18 16:34
 */
@Entity
@Table(name = "flower", schema = "flower_db", catalog = "")
public class FlowerEntity {
    private Integer flowerId;
    private String flowerName;
    private Integer flowerNum;
    private Date flowerDate;
    private String flowerImg;
    private BigDecimal flowerPrice;
    private Integer typeId;

    private BigDecimal pricemin;
    private BigDecimal pricemax;

    public BigDecimal getPricemin() {
        return pricemin;
    }

    public void setPricemin(BigDecimal pricemin) {
        this.pricemin = pricemin;
    }

    public BigDecimal getPricemax() {
        return pricemax;
    }

    public void setPricemax(BigDecimal pricemax) {
        this.pricemax = pricemax;
    }

    private MultipartFile flowerpath;

    public MultipartFile getFlowerpath() {
        return flowerpath;
    }

    public void setFlowerpath(MultipartFile flowerpath) {
        this.flowerpath = flowerpath;
    }

    public FlowerTypeEntity flowerTypeEntity;//一个鲜花对应一个类型

    public FlowerTypeEntity getFlowerTypeEntity() {
        return flowerTypeEntity;
    }

    public void setFlowerTypeEntity(FlowerTypeEntity flowerTypeEntity) {
        this.flowerTypeEntity = flowerTypeEntity;
    }

    @Id
    @Column(name = "flower_id")
    public Integer getFlowerId() {
        return flowerId;
    }

    public void setFlowerId(Integer flowerId) {
        this.flowerId = flowerId;
    }

    @Basic
    @Column(name = "flower_name")
    public String getFlowerName() {
        return flowerName;
    }

    public void setFlowerName(String flowerName) {
        this.flowerName = flowerName;
    }

    @Basic
    @Column(name = "flower_num")
    public Integer getFlowerNum() {
        return flowerNum;
    }

    public void setFlowerNum(Integer flowerNum) {
        this.flowerNum = flowerNum;
    }

    @Basic
    @Column(name = "flower_date")
    public Date getFlowerDate() {
        return flowerDate;
    }

    public void setFlowerDate(Date flowerDate) {
        this.flowerDate = flowerDate;
    }

    @Basic
    @Column(name = "flower_img")
    public String getFlowerImg() {
        return flowerImg;
    }

    public void setFlowerImg(String flowerImg) {
        this.flowerImg = flowerImg;
    }

    @Basic
    @Column(name = "flower_price")
    public BigDecimal getFlowerPrice() {
        return flowerPrice;
    }

    public void setFlowerPrice(BigDecimal flowerPrice) {
        this.flowerPrice = flowerPrice;
    }

    @Basic
    @Column(name = "type_id")
    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FlowerEntity that = (FlowerEntity) o;
        return Objects.equals(flowerId, that.flowerId) &&
                Objects.equals(flowerName, that.flowerName) &&
                Objects.equals(flowerNum, that.flowerNum) &&
                Objects.equals(flowerDate, that.flowerDate) &&
                Objects.equals(flowerImg, that.flowerImg) &&
                Objects.equals(flowerPrice, that.flowerPrice) &&
                Objects.equals(typeId, that.typeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(flowerId, flowerName, flowerNum, flowerDate, flowerImg, flowerPrice, typeId);
    }

    public FlowerEntity(Integer flowerId, String flowerName, Integer flowerNum, Date flowerDate, String flowerImg, BigDecimal flowerPrice, Integer typeId, FlowerTypeEntity flowerTypeEntity) {
        this.flowerId = flowerId;
        this.flowerName = flowerName;
        this.flowerNum = flowerNum;
        this.flowerDate = flowerDate;
        this.flowerImg = flowerImg;
        this.flowerPrice = flowerPrice;
        this.typeId = typeId;
        this.flowerTypeEntity = flowerTypeEntity;
    }

    public FlowerEntity() {
    }
}